﻿using ERPSystem.Common.BaseEntitys;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPSystem.Common.Domains.UserCommon
{
    /// <summary>
    /// 权限表
    /// </summary>
    [SugarTable("Permissions")]
    public class Permission: BaseEntity
    {
        /// <summary>
        /// 权限ID (主键，自增，不可为空)
        /// </summary>
        [SugarColumn(IsIdentity =true,IsPrimaryKey =true)]
        public int PermissionsId { get; set; }
        /// <summary>
        /// 权限名称
        /// </summary>
        [SugarColumn(ColumnDataType ="Nvarchar(100)")]
        public string PermissionsName { get; set; }
        /// <summary>
        /// 链接
        /// </summary> 
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string? URL { get; set; }
        /// <summary>
        /// 父级Id
        /// </summary>
        public int PerantId { get; set; }
        /// <summary>
        /// 是否可以查看 (可空)
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? CanView { get; set; } = true;

        /// <summary>
        /// 是否可以添加 (可空)
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? CanAdd { get; set; } = true;

        /// <summary>
        /// 是否可以编辑 (可空)
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? CanEdit { get; set; } = true;

        /// <summary>
        /// 是否可以删除 (可空)
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public bool? CanDelete { get; set; } = true;
    }
}
